/**
 * 我的画像-个人首页
 */
import { inject, observer } from 'mobx-react';
import React from "react";

import ComplexQualityCardCom from "./ComplexQualityCardCom";
import UserInfoCardCom from "./UserInfoCardCom";
import InfluenceItemsCom from "./InfluenceItemsCom";
import SysWorkRecordCom from "./SysWorkRecordCom";
import { i18n } from "../../../public/i18n";
import * as Util from "../../../util/Util";

@inject("individualMainStore")
@observer
export default class PersonalIndexView extends React.Component {

  constructor(props) {
    super(props);
    this.store = this.props.individualMainStore;
  }
  
  componentWillMount () {
    this.getData();
  }

  getData() {
    const { loadTabData } =this.store;
    loadTabData();
  }

  render() {
    const { hasRight} = this.store;
    if (!hasRight) {
      return Util.renderAlertPage(
        "<span style='color:red'>" + i18n.message.authFailed() + "</span>",
        "",
        "30%",
        Util.getCurrentHeight()-151
      );
    }
    return (
      <div className="wea-wr-portrait-personal-container">
        <UserInfoCardCom ecId={`${this && this.props && this.props.ecId || ''}_UserInfoCardCom@iwnvoj`} />
        <ComplexQualityCardCom ecId={`${this && this.props && this.props.ecId || ''}_ComplexQualityCardCom@ticd04`}/>
        <InfluenceItemsCom ecId={`${this && this.props && this.props.ecId || ''}_InfluenceItemsCom@xhalqi`} />
        <SysWorkRecordCom ecId={`${this && this.props && this.props.ecId || ''}_SysWorkRecordCom@jduell`} />
      </div>
    );
  }
  
}
